package com.nstar.orderexpress.view
{
	import com.nstar.orderexpress.mxml.LoginView;
	
	import flash.events.MouseEvent;
	
	import mx.containers.HBox;
	import mx.controls.Button;
	import mx.controls.Image;
	import mx.controls.TextInput;
	import mx.events.FlexEvent;

	public class UserViewClass extends HBox
	{
		public var btnLogin:Button;
		public var imgStatus:Image;
		
		public var txtName:TextInput;
		public var txtMobile:TextInput;
		public var txtAddress:TextInput;
		
		public function UserViewClass()
		{
			//TODO: implement function
			super();
			this.addEventListener(FlexEvent.CREATION_COMPLETE,init);
		}
		
		public function validate():Boolean{
			return (txtName.text != "") && (txtMobile.text != "") && (txtAddress.text !="");
		}
		
		private function init(event:FlexEvent):void{
			btnLogin.addEventListener(MouseEvent.CLICK,loginHandler);
		}
		
		//登录
		private function loginHandler(event:MouseEvent):void{
			LoginView.show();
		}
		
	}
}